package com.tledu.zyf.servlet.group;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tledu.zyf.model.Group;
import com.tledu.zyf.util.ForwardUtil;
import com.tledu.zyf.util.ObjectFactory;

@WebServlet("/group/updateInput")
public class GroupUpdateInputServlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		int id = Integer.parseInt(request.getParameter("id"));
		Group group = ObjectFactory.getGroupService().load(id);
		request.setAttribute("group", group);
		// 跳转到添加页面
		ForwardUtil.forward(request, response, "group/update");
	}
}
